#ifndef POINT_H_
#define POINT_H_

#include "Vector.h"

namespace Geometry
{
	class Point
	{
		float m_x;
		float m_y;
		float m_z;

	public:
		Point():m_x(0.0),m_y(0.0),m_z(0.0){}
		Point(float _x, float _y, float _z = 0.0):m_x(_x),m_y(_y),m_z(_z){}

		inline void operator()(float _x, float _y, float _z );

		inline float x() const { return m_x; }
		inline void  x(float _x) { m_x = _x; }

		inline float y() const { return m_y; }
		inline void  y(float _y) {m_y = _y; }
		
		inline float z() const { return m_z; }
		inline void  z(float _z) { m_z = _z; }
	};

	inline void Point::operator()(float _x, float _y, float _z)
	{
		m_x = _x;
		m_y = _y;
		m_z = _z;
	}

	inline Vector operator+( const Point& _a , const Point& _b )
	{
		return Vector( _a.x() + _b.x(),
			           _a.y() + _b.y(),
					   _a.z() + _b.z() );
	}

	inline Vector operator-( const Point& _a , const Point& _b )
	{
		return Vector( _a.x() - _b.x(),
			           _a.y() - _b.y(),
					   _a.z() - _b.z() );
	}

	inline Point operator+( const Vector& _v, const Point& _p)
	{
		return Point( _p.x() + _v.x(),
			          _p.y() + _v.y(),
					  _p.z() + _v.z() );
	}

	inline Point operator+( const Point& _p, const Vector& _v)
	{
		return Point( _p.x() + _v.x(),
			          _p.y() + _v.y(),
					  _p.z() + _v.z() );
	}

	inline Point operator-( const Vector& _v, const Point& _p)
	{
		return Point( _p.x() - _v.x(),
			          _p.y() - _v.y(),
					  _p.z() - _v.z() );
	}

	inline Point operator-( const Point& _p, const Vector& _v)
	{
		return Point( _p.x() - _v.x(),
			          _p.y() - _v.y(),
					  _p.z() - _v.z() );
	}
}

#endif